package com.wzm.system.service.impl;


import com.wzm.basic.service.impl.BaseServiceImpl;
import com.wzm.system.domain.DictionaryDetail;
import com.wzm.system.mapper.DictionaryDetailMapper;
import com.wzm.system.service.DictionaryDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DictionaryDetailServiceImpl extends BaseServiceImpl<DictionaryDetail> implements DictionaryDetailService {
    @Autowired
    private DictionaryDetailMapper dictionaryDetailMapper;

    @Override
    public List<Long> findById(Long types_id) {
        List<Long> ids= dictionaryDetailMapper.findById(types_id);
        return ids;
    }

    @Override
    public List<DictionaryDetail> findAllById(Long types_id) {
        return dictionaryDetailMapper.findAllById(types_id);
    }


    /*
    @Override
    public AjaxResult update1(DictionaryDetail dictionaryDetail) {
        String name = dictionaryDetail.getName();
        Long id = dictionaryDetail.getId();
        DictionaryDetail detail = dictionaryDetailMapper.loadById(id);
        if(name==detail.getName()){
            return new AjaxResult(false,"字典明细名称重复");
        }
        dictionaryDetailMapper.update(dictionaryDetail);
        return new AjaxResult();
    }*/

   /* @Override
    public AjaxResult add1(DictionaryDetail dictionaryDetail) {
        String name = dictionaryDetail.getName();
        dictionaryDetailMapper.save(dictionaryDetail);
        Long id = dictionaryDetail.getId();
        DictionaryDetail detail = dictionaryDetailMapper.loadById(id);
        if(name==detail.getName()){
            dictionaryDetailMapper.remove(id);
            return new AjaxResult(false,"字典明细名称重复");
        }
        dictionaryDetailMapper.update(dictionaryDetail);
        return new AjaxResult();
    }*/
}
